//
//  AboatViewController.m
//  FbeeAPP
//
//  Created by dev-m on 2018/3/22.
//  Copyright © 2018年 mohao. All rights reserved.
//

#import "AboatViewController.h"
#import "UrlLabel.h"

@interface AboatViewController ()
{
    UIImageView *logo;
    UILabel *version;
    UrlLabel *content;
}

@end

@implementation AboatViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.largeTitle setTitle:NSLocalizedString(@"uCenterAbout", nil)];
    
    [self buildView];

}

-(void)buildView
{
    logo = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.largeTitle.bottom + 40*UISCALE, 64*UISCALE, 64*UISCALE)];
    logo.image = [UIImage imageNamed:@"logo_180"];
    logo.centerX = IPHONEWIDTH/2;
    [self.view addSubview:logo];
    
    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
    NSString *appVersion = [infoDic objectForKey:@"CFBundleShortVersionString"];
    version = [UILabel makeLabel:^(TTLabelExtend *make) {
        make.addTextColor(FBEE_COLOR_TEXT).addFont([UIFont systemFontOfSize:14.0f]);
        make.addText([NSString stringWithFormat:@"V%@",appVersion]);
        [make sizeToFit];
        make.top = logo.bottom + 10*UISCALE;
        make.centerX = IPHONEWIDTH/2;
        [self.view addSubview:make];
    }];
    
    content = [[UrlLabel alloc] initWithFrame:CGRectMake(20, 0, IPHONEWIDTH - 20 * 2, 100*14)];
    content.numberOfLines = 100;
    
    NSString *contentText = @"Fbee 连接区块链项目方与大众用户的第一社区平台。我们致力于提升全球用户的token化体验，让全人类均享受到来自区块链技术所带来的时代革新。\n\n我们坚信：区块链会改变世界，而社区的力量是每一个区块链项目发展的根基。\n\n\n用户反馈：support@fbee.one\n商务合作：marketing@fbee.one";
    
    [content setText:contentText textColor:FBEE_COLOR_TEXT font:[UIFont systemFontOfSize:14.0f] urlColor:FBEE_COLOR_BLUE urlTapBlock:^(NSURL *url) {

        NSString *str = [url.absoluteString stringByReplacingOccurrencesOfString:@"https://" withString:@""];
        str = [str stringByReplacingOccurrencesOfString:@"http://" withString:@""];
        UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
        [pasteboard setString:str];
        [NoticePopHelper showNoticeText:NSLocalizedString(@"msgCopySuccess", nil)];
        
        
        
    }];
    [content sizeToFit];
    content.top = version.bottom + 25*UISCALE;
    [self.view addSubview:content];
}


@end
